#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#

Import('BuildEnv')

env = BuildEnv.Clone()

libs = [
    'bgp',
    'routing_instance',
    'routing_policy',
    'extended_community',
    'security_group',
    'tunnel_encap',
    'origin_vn',
    'peer_sandesh',
    'route',
    'net',
    'db',
    'sandesh',
    'process_info',
    'http',
    'ssl',
    'crypto',
    'http_parser',
    'io',
    'base',
    'curl',
    'pugixml',
    'boost_regex',
    'boost_program_options',
    'boost_filesystem',
]

feature_libs = [
    'bgp_ermvpn',
    'bgp_evpn',
    'bgp_inet',
    'bgp_inet6',
    'bgp_inet6vpn',
    'bgp_l3vpn',
    'bgp_mvpn',
    'extended_community',
    'rtarget',
]

linkflags = ['-Wl,--whole-archive']
linkflags += map(lambda x: '-l' + x, feature_libs)
linkflags += ['-Wl,--no-whole-archive']
env.Prepend(LINKFLAGS = linkflags)

env.Prepend(LIBS=libs)
env.Append(LIBS=feature_libs)

libpath = [
    '..',
    '../inet',
    '../inet6',
    '../inet6vpn',
    '../ermvpn',
    '../evpn',
    '../extended-community',
    '../l3vpn',
    '../mvpn',
    '../origin-vn',
    '../routing-instance',
    '../routing-policy',
    '../rtarget',
    '../security_group',
    '../tunnel_encap',
    '../../db',
    '../../net',
    '../../route',
]

env.Append(LIBPATH = map(lambda x: Dir(x), libpath))

daemon = env.Program(target = 'bgp-daemon',
                     source = ['main.cc'])
env.Alias('bgp-daemon', daemon)


# Local Variables:
# mode: python
# End:
